package restserviceplatform;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import views.errorView;

public class ShowViewAction extends Action {
	
	private IWorkbenchWindow window;
	private int instanceNum=0;
	
	public ShowViewAction(IWorkbenchWindow window)
	{
		this.window=window;
		this.setText("Show View");
	}
	
	public void run()
	{
		if(window != null) {	
			try {
				window.getActivePage().showView("RestServicePlatform.errorView");
			} catch (PartInitException e) {
				MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
			}
		}
	}

}
